QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Gradient Wipe

kGradientTransitionType ('matt')

The gradient wipe effect uses a matte image to create a transition between two source images. The transition from source 'A' to source 'B' will occur first where the matte image is darkest, last where the matte image is brightest.

During the effect, if the luminance value of the matte image at a given point is greater than the alpha threshold for the effect, the pixel from source 'A' is displayed. If the matte image's luminance value at that point is less than the alpha threshold, the pixel from source 'B' is displayed.

The alpha threshold increases as the effect progresses, eventually causing it to be higher than the luminance value of the matte image at all points, so that only the pixels from source 'B' are displayed.

The equation for the change in the alpha threshold as the effect progresses is:

alphaTheshold = (percent_complete / 100) * 255

so the alpha threshold goes from 0 to 255 over the course of the effect.

The algorithm used to animate the transition is:

for (y=0; y<height; y++) {
for (x=0; x<width; x++) {
if (matte_image_luminiance(x,y) > alphaThreshold)
output pixel source_A(x,y)
else
output pixel source_B(x,y)
}
}
Example:

The example above uses a matte image of Shakespeare to control the transition from source `A' to source `B'.

The gradient wipe effect takes two sources and has two parameters.

Parameters

Use the descriptions below to help you understand what the parameters do. To learn how to use parameter atoms, see "Adding Video Effects to a QuickTime Movie"

Name

Code

QTAtom Type

Description

Percentage

'pcnt'

kParameterTypeDataFixed

Always a tween

This parameter contains a tween. As the effect progresses, QuickTime renders the frame of the effect indicated by the tween's current value, as a percentage of the whole effect. For example, if the tween goes from 0 to 100, the effect renders completely; if the tween goes from 25 to 75, rendering begins 25% into the effect and terminates 75% through the effect.

Matte image

'matt'

kParameterTypeDataImage

The matte image. The transition from source 'A' to source 'B' will occur first where the matte image is darkest, last where the matte image is brightest. A greyscale matte image is recommended.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |